
function bindMenu(menuId, menuStore) {
    var menu = dijit.byId(menuId);
    dojo.connect(menu, "onClick", function(item) {
        var targetPane = dijit.byId("workPane");
        var targetPage = menuStore.getValue(item, "link");
        targetPage += '?rd=' + Math.random();
        targetPane.set("href", targetPage);
    });
    dojo.connect(menu, "getIconClass", function(item, opened) {
        if (item && menuStore.getValue(item, "icon") != "") {
            return menuStore.getValue(item, "icon");
        } else {
            return "dijitLeaf";
        }
    });
}